import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/views/login/LoginPage.vue'),
    },
    {
      path: '/layout',
      component: () => import('@/views/layout/LayoutPage.vue'),
      redirect: '/learning',
      children: [
        {
          path: '/learning',
          component: () => import('@/views/learning/LearningDynamicsPage.vue'),
        },
        {
          path: '/course/classification',
          component: () => import('@/views/course/CourseClassificationPage.vue'),
        },
        {
          path: '/course/series',
          component: () => import('@/views/course/CourseSeriesPage.vue'),
        },
      ],
    },
  ],
})

export default router
import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import CourseUploadView from '../views/CourseUploadView.vue';
import UserManagementView from '../views/UserManagementView.vue';
import RoleManagementView from '../views/RoleManagementView.vue';
 
const routes = [
  {
    path: '/',
    name: 'Home',
    component: HomeView
  },
  {
    path: '/course-upload',
    name: 'CourseUpload',
    component: CourseUploadView
  },
  {
    path: '/user-management',
    name: 'UserManagement',
    component: UserManagementView
  },
  {
    path: '/role-management',
    name: 'RoleManagement',
    component: RoleManagementView
  }
];
 
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
});
 
export default router;

